#include "widget.h"
#include "ui_widget.h"
#include <QDebug>
#include <QMouseEvent>

Widget::Widget(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::Widget)
{
    ui->setupUi(this);

    this->setMouseTracking(true);
}

Widget::~Widget()
{
    delete ui;
}

void Widget::mouseMoveEvent(QMouseEvent *event)
{
//    qDebug()<<event->x()<<" "<<event->y()<<" ";
}

void Widget::wheelEvent(QWheelEvent *event)
{
    //    qDebug()<<event->delta();
}

void Widget::keyPressEvent(QKeyEvent *event)
{
//     qDebug()<<event->key();
//    if(event->key()==Qt::Key_A)
//    {
//        qDebug()<<"你按下了A键";
//    }
    if(event->key()==Qt::Key_A&&event->modifiers()==Qt::ControlModifier)
    {
        qDebug()<<"你按下了ctr + A";
    }
}

